<?php
/*
 * name: cxm
 * desc: 广告位表
 * date: 2019/10/23
 * */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateAdvPositionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('adv_position', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->string('name')->comment('广告位名称');
            $table->tinyInteger('num')->default(1)->comment('对应广告位数量');
            $table->string('width')->nullable()->comment('广告位宽度');
            $table->string('height')->nullable()->comment('广告位高度');
            $table->timestamps();
            $table->softDeletes();
        });
        // 表注释
        DB::statement("ALTER TABLE `".config('database.connections.mysql.prefix')."adv_position` comment'广告位表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('adv_position');
    }
}
